<template>
  <div class="dashboard-container">
    <div class="dashboard-top">
      <div>应用管理</div>
    </div>
    <div class="dashboardCont">
      <div class="cardsItems" v-for="(item, index) in dataes" :key="index">
        <router-link :to="{ path:item.path }" :style="{color:item.color}">
          <div class="iconBox" :style="{backgroundColor:item.color}"><span :class="item.icon"></span></div>
          <div class="title">{{item.title}}</div>
        </router-link>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  data() {
    return {
      dataes: [
        { title: '签到', icon: 'icon iconqiandao', path: '/register', color: '#fd882c' },
        { title: '考勤', icon: 'icon iconqiandao-kaoqindaqia', path: '/attendance', color: '#49c2d4' },
        { title: '审批', icon: 'icon iconshenpiren', path: '/approval', color: '#f6a920' },
        { title: '文档', icon: 'icon iconwendang', path: '/file', color: '#5c84f6' }
      ]
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },


}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    padding:15px;
    .dashboardCont {
      margin: 0 auto;
      width: 1200px;
      display: flex;
      flex-wrap: wrap;
      .cardsItems{
        width: 220px;
        height: 130px;
        padding: 20px;
        padding-top: 30px;
        margin: 10px;
        border-radius: 2px;
        box-shadow: 2px 2px 8px #e8e9ec;
        background: #fff;
        text-align: center;
        .iconBox{
          display: inline-block;
          width: 40px;
          height: 40px;
          line-height: 40px;
          border-radius: 100%;
          color: #fff;
          text-align: center;
          .icon{
            font-size: 22px;
          }
        }
        .title{
          line-height: 40px;
          font-size: 16px;
        }
      }
    }
  }
  &-top {
    margin: 0 auto;
    width: 1200px;
    padding-left: 15px;
    font-size: 16px;
    line-height: 50px;
  }
}
</style>
